package com.qding.park.adapter.report.valid;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class EventTypeValid implements ConstraintValidator<EventType, String>{
    
    private EventType constraintAnnotation;

    @Override
    public void initialize(EventType constraintAnnotation) {
        this.constraintAnnotation=constraintAnnotation;
    }

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        
        if("alarm-lockcar".equals(value)){
            //锁车报警事件
            return true;
        }else if("notice-visitor".equals(value)){
            //访客来访通知
            return true;
        }
        return false;
    }

}
